package com.lieve.bpm.config;

import com.lieve.bpm.common.extend.history.LieveProcessHistoryManagerSessionFactory;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.activiti.spring.SpringProcessEngineConfiguration;
import org.activiti.spring.boot.DataSourceProcessEngineAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @author sunlijiang
 * @date 2020/5/1
 */
@Slf4j
//@Component
@AutoConfigureBefore(DataSourceProcessEngineAutoConfiguration.class)
public class BpmConfig {

    /*@Bean
    public LieveProcessHistoryManagerSessionFactory processHistoryManagerSessionFactory() {
        return new LieveProcessHistoryManagerSessionFactory();
    }*/

    @Bean
    public StandaloneProcessEngineConfiguration standaloneProcessEngineConfiguration() {
        return new DataSourceProcessEngineConfiguration();
    }
}
